import request from '@/utils/request'

export default {
  upload(data,file_name = 'avatar.png'){
    let param = new FormData();  
    param.append('file', data, file_name);
    let config = {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    };  

    return request.post('/file/upload', param, config);
  }
}